package com.jhx.service.impl;

import com.github.pagehelper.PageHelper;
import com.jhx.dao.ProductMapper;
import com.jhx.pojo.Product;
import com.jhx.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class ProductServiceImpl implements ProductService {
    @Autowired
    private ProductMapper productMapper;
    @Override
    public List<Product> findProductAll(String name, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        return productMapper.findProductAll(name);
    }

    @Override
    public Product findProductById(Integer id) {
        return productMapper.findProductById(id);
    }

    @Override
    public int deleteProductById(List<String> id) {
        return productMapper.deleteProductById(id);
    }
}
